home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld: Complete Mac Interactive
/
Macworld Complete Mac Interactive CD)(1994).iso
/
The Best of BMUG
/
Utilities
/
Text and Speech
/
Alpha.5.76
/
Tcl
/
SystemCode
/
browser.tcl
< prev
next >
Wrap
Text File
|
1994-03-08
|
1KB
|
60 lines
#=============================================================================
# Browser mode.
#=============================================================================
proc upBrowse {} {
if {[lineStart [getPos]] > 0} {
select [getPos]
previousLine
}
select [lineStart [getPos]] [nextLineStart [getPos]]
}
bind up upBrowse BRWZ
proc downBrowse {} {
if {[nextLineStart [getPos]] != [maxPos]} {
select [getPos]
nextLine
}
select [lineStart [getPos]] [nextLineStart [getPos]]
}
bind down downBrowse BRWZ
proc gotoError {} {
set text [getText [lineStart [getPos]] [nextLineStart [getPos]]]
set line [lindex $text 3]
set err [lindex $text 5]
set fname [lindex $text 6]
if {[expr {[lsearch [winNames -f] $fname] >= 0}]} {
bringToFront $fname
} else {
edit $fname
}
set pos [rowColToPos $line 0]
select $pos [nextLineStart $pos]
}
bind '\r' gotoError BRWZ
bind enter gotoError BRWZ
proc nextError {} {
downBrowse
gotoError
}
proc previousError {} {
upBrowse
gotoError
}
menu -n Browse {
"gotoError"
"nextError"
"previousError"
}
proc setBrowseMode {} {
changeMode "BRWZ"
insertMenu "Browse"
}